package org.fastframework.boot.web.embedded.jetty;

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletHandler;
import org.fastframework.boot.web.servlet.DispatcherServlet;

public class JettyStarter {

    public static void start() {
        Server server = new Server(9090);
        ServletHandler handler = new ServletHandler();
        handler.addServletWithMapping(DispatcherServlet.class, "/*");
        server.setHandler(handler);
        try {
            server.start();
            server.join();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
